//===== eAthena Script ======================================= 
//= Notice Board
//===== By: ================================================== 
//= Arcenciel
//===== Version and Changes ==================================
//= 1.0		-Finished and released the script
//= 2.0		-Script Optimized
//===== Description: ========================================= 
//= This simple script creates a small Notice Board ingame.
//= It allows GMs to post things in order for those who miss
//= important announcements to know about them.
//=
//= It allows people who does not go to the forums frequently
//= know when to check the forums for important stuff
//=
//===== All credits reserved to Arcenciel ====================

prontera,154,196,3	script	Notification Board	837,{

	set .@gmpostinglevel,80;

	if( getgmlevel() >= .@gmpostinglevel )
	{
		mes "What would you like to do?";
		next;
		menu "Read Board",-,"Post New Notice",Postnew,"Delete Post",Delpost;
	}

	if( !.notice )
	{
		mes "*The Board does not have any post*";
		close;
	}

	mes "[^FF0000"+.title$+"^000000]";
	mes "Posted by ^0033FF"+.poster$+"^000000";
	mes "On ^0033FF"+.dateposted$+"^000000";
	mes .message$[0];
	mes .message$[1];
	mes .message$[2];
	mes .message$[3];
	mes .message$[4];
	close;

Postnew:
	mes "Enter title of the Notice";
	input .@ttitle$;
	set .@tposter$,strcharinfo(0);
	set .@tdateposted$,gettimestr("%Y-%m/%d %H:%M:%S",21);
	next;
	mes "Enter Part 1 of Notice";
	input .@tmessage$[0];
	if(select("Add 2nd Message:That's enough messages")==2) goto L_Fin;
	mes "Enter Part 2 of Notice";
	input .@tmessage$[1];
	if(select("Add 3rd Message:That's enough messages")==2) goto L_Fin;
	mes "Enter Part 3 of Notice";
	input .@tmessage$[2];
	if(select("Add 4th Message:That's enough messages")==2) goto L_Fin;
	mes "Enter Part 4 of Notice";
	input .@tmessage$[3];
	if(select("Add 5th Message:That's enough messages")==2) goto L_Fin;
	mes "Enter Part 5 of Notice";
	input .@tmessage$[4];

L_Fin:
	mes "This is how the post would look like";
	next;
	mes "[^FF0000"+.@ttitle$+"^000000]";
	mes "Posted by ^0033FF"+.@tposter$+"^000000";
	mes "On  ^0033FF"+.@tdateposted$+"^000000";
	mes .@tmessage$[0];
	mes .@tmessage$[1];
	mes .@tmessage$[2];
	mes .@tmessage$[3];
	mes .@tmessage$[4];
	next;
	mes "Post it?";
	if(select("Yes:No")==2)
	{
		mes "*You erased whatever you wrote*";
		cleararray .@tmessage$[0],"",5;
		close;
	}

	set .title$,.@ttitle$;
	set .poster$,.@tposter$;
	set .dateposted$,.@tdateposted$;
	setarray .message$[0],.@tmessage$[0],.@tmessage$[1],.@tmessage$[2],.@tmessage$[3],.@tmessage$[4];

	mes "*You have just posted a new notice*";
	announce "[Server] "+.poster$+" has just placed a new notice, Please check the Notification board for details.",bc_all;
	
	set .notice,1;
	close;

Delpost:
	mes "The post has been deleted";
	set .notice,0;
	set .title$,"";
	set .poster$,"";
	set .dateposted$,"";
	cleararray .message$[0],"",5;
	close;
}